import {NgModule} from "@angular/core";
import {RouterModule, Routes} from "@angular/router";
import {SharedModule} from "../../shared/shared.module";

import {StarLevelListComponent} from "./star-level-list/star-level-list.component";
import {StarLevelDetailComponent} from "./star-level-detail/star-level-detail.component";
import {StarLevelEditComponent} from "./star-level-edit/star-level-edit.component";
import {StarLevelRuleListComponent} from "./star-level-rule-list/star-level-rule-list.component";
import {StarLevelRuleDetailComponent} from "./star-level-rule-detail/star-level-rule-detail.component";
import {StarLevelRuleEditComponent} from "./star-level-rule-edit/star-level-rule-edit.component";
import {StarRecordListComponent} from "./star-record-list/star-record-list.component";
import {StarRecordDetailComponent} from "./star-record-detail/star-record-detail.component";

const routes: Routes = [
    {path: '', redirectTo: ' star-levels'},
    {path: 'star-levels', children: [
        {path: '', redirectTo: 'list'},
        {path: 'list', component: StarLevelListComponent},
        {path: 'add', component: StarLevelEditComponent},
        {path: 'modify/:code', component: StarLevelEditComponent},
        {path: 'detail/:code', component: StarLevelDetailComponent}
    ]},

    {path: 'star-level-rule', children: [
        {path: '', redirectTo: 'list'},
        {path: 'list', component: StarLevelRuleListComponent},
        {path: 'add', component: StarLevelRuleEditComponent},
        {path: 'modify/:id', component: StarLevelRuleEditComponent},
        {path: 'detail/:id', component: StarLevelRuleDetailComponent}
    ]},

    {path: 'star-record', children: [
        {path: '', redirectTo: 'list'},
        {path: 'list', component: StarRecordListComponent},
        {path: 'detail/:code', component: StarRecordDetailComponent}
    ]}
];

@NgModule({
  imports: [
    SharedModule.forRoot(),
    RouterModule.forChild(routes)
  ],
  declarations: [
    StarLevelListComponent,
    StarLevelDetailComponent,
    StarLevelEditComponent,
    StarLevelRuleListComponent,
    StarLevelRuleDetailComponent,
    StarLevelRuleEditComponent,
    StarRecordListComponent,
    StarRecordDetailComponent
  ],
  providers: []
})
export class StarModule {
}
